// import request from '@/utils/request'

// // getDepartments获取部门 getsimpleEmployee获取员工数据
// // addDepartment添加数据 delDepartments删除员工
// // getDepartDetail获取部门详情id updateDepartments更新部门数据

// // 发送异步请求保存部门数据
// export function getDepartments() {
//   return request.get('/api/company/department')
// }

// // 获取员工信息数据
// export function getsimpleEmployee() {
//   return request.get('/api/sys/user/simple')
// }

// // 点击确认修改后校验，合并对象
// export const addDepartment = function(data) {
//   return request.post('/api/company/department', data)
// }
// // 接口/company/department/id中的id是一个占位符，需要我们带入真实的id,运用拼接的方法
// export const delDepartments = function(id) {
//   return request.delete('/api/company/department/' + id)
// }
// // 获取部门详情
// export const getDepartDetail = function(id) {
//   return request.get('/company/department/' + id)
// }
// // 更新部门数据的接口
// export const updateDepartments = function(data) {
//   return request.put('/company/department/' + data.id, data)
// }

import request from '@/utils/request'

export function getDepartments() {
  return request({
    url: '/api/company/department'
  })
}

// 获取简单员工数据
export const getEmployeeSimple = function() {
  return request.get('/api/sys/user/simple')
}
export const addDepartment = function(data) {
  return request.post('/api/company/department', data)
}
// 接口/company/department/id中的id是一个占位符，需要我们带入真实的id,运用拼接的方法
export const delDepartmen = function(id) {
  return request.delete('/api/company/department/' + id)
}

// 获取部门详情
export const getDepartmentById = function(id) {
  return request.get('/api/company/department/' + id)
}
// 更新部门数据的接口
export const updataDepartment = function(data) {
  return request.get('/api/company/department/' + data.id, data)
}
